<form id="sysmenuForm" lay-filter="menuForm" class="layui-form model-form">
    <input name="id" type="hidden" value=""/>
    <div class="layui-form-item">
        <label class="layui-form-label">父级
            <span style="color: red;">*</span>
        </label>
        <div class="layui-input-block">
            <ul id="parentIdTree" class="dtree" data-id="0"></ul>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">名称
            <span style="color: red;">*</span>
        </label>
        <div class="layui-input-block">
            <input name="title" placeholder="请输入名称" value="" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">权限规则
            <span style="color: red;">*</span>
        </label>
        <div class="layui-input-block">
            <input name="name" placeholder="请输入权限规则" value="" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否是菜单
            <span style="color: red;">*</span>
        </label>
        <div class="layui-input-block">
            <select name="ismenu" lay-verify="ismenu">
                <option value="1">菜单</option>
                <option value="0">节点</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">附件条件
            <span style="color: red;">*</span>
        </label>
        <div class="layui-input-block">
            <input name="condition" placeholder="请输入附件条件" value="" type="text" class="layui-input" autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input name="sort" placeholder="请输入排序" value="" type="text" class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图标</label>
        <div class="layui-input-block">
            <!--<input name="icon" placeholder="请输入图标" value="" type="text" class="layui-input"/>-->
            <input type="text" name="icon" value="layui-icon layui-icon-username" placeholder="请选择" maxlength="16" autocomplete="off" class="layui-input" id="icon"/>
        </div>
    </div>
</form>
<script>
    yq_dtree('parentIdTree',{
        url:'{:url("/admin/widget.sysmenu/getAllList")}',
        checkbar: false
    },function(){
        layui.dtree.dataInit("parentIdTree", "{$sysMenu.pid}");
        layui.dtree.selectVal("parentIdTree"); // 也可以在这里指定，第二个参数如果不填，则会自动读取
    });
    layui.iconSelected.init("#icon",{
        offsetX:-300,
        offsetY:30
    });
    layui.form.render();
</script>
